const express = require('express');
const bodyParser = require('body-parser');
const router = express.Router();
const app = express()
const refreshToken = require('../wx_server/getWebToken');

const getJsApiData = require('../wx_server/getJsApiData')

app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());


/* GET users listing. */
router.get('/', function(req, res)  {
    var clientUrl =  req.query.url;
    setTimeout(function () {
        getJsApiData(clientUrl).then(function (data) {
            console.log('返回值data  :' + data)
            res.jsonp({signature: data[0], timestamp: data[1], nonceStr: data[2], appId: 'wx5c40bb6d9e8461f6'});
        });
    },1000)
})

module.exports = router;
